//
//  UnitEditController.h
//  MapEdit
//
//  Created by Steven Canfield on 6/27/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "Unit.h"
#import "UnitNameAddition.h"
#import "PlayerNameAddition.h"
@class MapView;

@interface UnitEditController : NSObject {
	NSMutableArray * selectedUnits;
	
	IBOutlet NSPopUpButton * unitTypeButton;
	IBOutlet NSPopUpButton * unitOwnerButton;
	
	IBOutlet NSTextField * coordinateX;
	IBOutlet NSTextField * coordinateY;
	
	IBOutlet NSSlider * healthSlider;
	IBOutlet NSTextField * healthField;
	IBOutlet NSSlider * shieldSlider;
	IBOutlet NSTextField * shieldField;
	IBOutlet NSSlider * energySlider;
	IBOutlet NSTextField * energyField;
	
	IBOutlet NSTextField * resourceField;
	IBOutlet NSTextField * resourceLabel;
	
	IBOutlet NSButton * cloakedBox;
	IBOutlet NSButton * hallucinatedBox;
	IBOutlet NSButton * burrowedBox;
	IBOutlet NSButton * invincibleBox;
	
	NSArray * allItems;
	BOOL disabled;
	
	IBOutlet MapView * mapView;
}

- (Unit *)currentUnit;
- (BOOL)containsUnit:(Unit *)unit;
- (void)addUnit:(Unit *)unit;
- (void)clearSelection;
- (Unit *)unitAtIndex:(NSInteger)index;
- (void)removeUnit:(Unit *)unit;
- (void)removeUnitAtIndex:(NSInteger)index;
- (void)updateEditPanel;
- (IBAction)updateControl:(id)sender;
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem;
- (void)updateSlider:(NSSlider *)slider withField:(NSTextField *)field object:(id)someObject selector:(SEL)selector;
- (void)enableControl:( NSControl *)aControl;
- (void)disableControl:( NSControl *)aControl;
- (void)updateControl:(NSControl *)control fromObject:(id)someObject forProperty:(NSString * )propertyName;
@end